<?php
    $arrQuestion = $this->question;
    $arrUserQuestion = $this->userquestion;

?>
<table width="560" cellspacing="0" cellpadding="5" border="0" class="table_danhsach">
    <tbody><tr>
            <td colspan="4" class="td"><strong>Danh sách câu hỏi</strong></td>
        </tr>
        <tr style="font-weight: bold">
            <td align="center">Mã chứng khoán</td>
            <td align="center">Số lượng</td>
            <td align="center">Tổng có</td>
            <td align="center">Chức năng</td>
        </tr>
        <?php
            if(!empty($arrUserQuestion)) :
                 foreach($arrUserQuestion as $value) :
                     $timeCreate = date('Y-m-d', strtotime($value['createtime']));
                     $now = date('Y-m-d');
        ?>
        <tr>
            <td align="center"><?=$arrQuestion[$value['mackid']]?></td>
            <td align="center"><?=$value['amount']?$value['amount']:0?></td>
            <td align="center"><?=$value['total']?$value['total']:0?></td>
            <td align="center">
            <?php
                if($timeCreate!=$now){
                    echo '<a href="/question/refuse?id='.$value['id'].'">Refuse</a>';
                }
            ?>
            </td>
        </tr>
        <?php
                endforeach;
            endif;
        ?>
    </tbody>
</table>